<template>
	<div id="beautiful_detail">
		<div id="app">
				<div class="cover" :style="{'background-image':'url('+'https://yo.docshare.org.cn'+article.background+')'}">
				
					<div  class="title">
					<p>
						{{article.articletitle}}
					</p>
					<div class="writer">
						<img class="name" src="https://yo.docshare.org.cn/static/images/head2.jpg">
						<label>{{article.name}}</label>
						<span>{{article.articletime}}</span>
					</div>
					<div class="clear"></div>
				</div>
				<div class="read">
					<img class="eye" src="https://yo.docshare.org.cn/static/images/read.png">
					<span>999+</span>
				</div>
	
			</div>
				<div class="fill">
				<div class="con">
					<p>{{article.articlecontent}}</p>
					<img :src="'https://yo.docshare.org.cn'+article.contentphoto">
				   </div>
			</div>
			<div id="leave">
				<div class="comment">
					<a @click="itemClicked(article)">
						<img src="https://yo.docshare.org.cn/static/images/comment.png">
						<span>3</span>
					</a>
				</div>
				<div class="thumb">
					<a >
						<img src="https://yo.docshare.org.cn/static/images/thumb.png">
						<span>12</span>
					</a>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	import config from '@/config'
	export default {
		data() {
			return {
				uni,
				article: {},
				vid:'',
			}
		},
		methods:{
			itemClicked: function(item) {
				uni.navigateTo({
					url:`note_comment_list?id=${item.id}`
				})
			},
		},
		onLoad(option) {
			if(option.id){
				this.vid = option.id;
			}
			var that = this;
			uni.request({
				url:`${config.baseUrl}/article/one?id=${that.vid}&token=${uni.getStorageSync('token')}`,
				method:"GET",
				success(r) {
					if (r.data.succ) {
						that.article = r.data.data;
					} else {
						
					}
				},
					complete(res){
						if(res.data && res.data.msg){
							uni.showToast({
								icon:'none',
								title:res.data.msg
							})
						}
					},
			})
		}
	}
</script>

<style>
</style>
